Skip to content

PMP support#460

Closed
WhatAmISupposedToPutHere wants to merge 117 commits intoAsahiLinux:asahi-wipfrom
WhatAmISupposedToPutHere:feldspar
Closed

PMP support#460
WhatAmISupposedToPutHere wants to merge 117 commits intoAsahiLinux:asahi-wipfrom
WhatAmISupposedToPutHere:feldspar

Conversation

@WhatAmISupposedToPutHere
Copy link

@WhatAmISupposedToPutHere WhatAmISupposedToPutHere commented Feb 27, 2026

Works on M1 Pro and saves about 1W of power there, will not work on vanilla M1 (that uses pmp v1, not v2), and hopefully should work on m1 max/ultra and m2 vanilla/pro/max/ultra.

jannau and others added 30 commits February 15, 2026 18:16
arm64: dts: apple: t8112: Add "ps_disp0_cpu0" as resets for dcp

arm64: dts: apple: t8112-j473: Add dptx-phy power-domain

The HDMI output used by framebuffer0 requires the display controller and
external DP phy power-domains to remain active.

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Hector Martin <marcan@marcan.st>
Removes the "apple,always-on" property from ps_disp0_fe/cpu0.

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Asahi Lina <lina@asahilina.net>
to be dropped

Signed-off-by: Asahi Lina <lina@asahilina.net>
to be dropped

Signed-off-by: Asahi Lina <lina@asahilina.net>
to be dropped

Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Hector Martin <marcan@marcan.st>
These should work now that we have cpuidle.

Signed-off-by: Hector Martin <marcan@marcan.st>
These should work now that we have cpuidle.

Signed-off-by: Hector Martin <marcan@marcan.st>
These should work now that we have cpuidle.

Signed-off-by: Hector Martin <marcan@marcan.st>
Without this, the OF core ends up limiting all DMA masks to the default
32-bit, since that runs before drivers set up the proper DMA mask.

Skipping the highest page because it is impossible to express a full
64-bit range in the DT.

Signed-off-by: Hector Martin <marcan@marcan.st>
Still contains the downstream commits:

arm64: dts: apple: t6022: Disable dcp thouroughly

Also disables "display" until it can be supported via dispext*.

arm64: dts: apple: t602x: Add initial Mac Studio (2023) device trees

They use the same GPIO pins and interrupts as the Mac Mini (M2 Pro, 2023)
so use a common .dtsi for those definitions.

Squashed commits to ease rebasing onto upstream t602x device trees which
contains changes from above commits but reordered them in hindsight of
knowing the full rooster of t602x devices.

Signed-off-by: Hector Martin <marcan@marcan.st>
Co-developed-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Co-developed-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
Upstream disliked the generic "apple,*" compatibility strings so the
t602x device trees upstream submission did not use them.
m1n1 will add them back but carry them for 6.18 and 6.19 based
downstream kernels.

Drop with 6.18 + 2

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Hector Martin <marcan@marcan.st>
machines with the tas2764 amp codec share a GPIO line for
asserting/deasserting the SDZ pin on the chips. describe
this as a regulator to facilitate chip reset on suspend/resume

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Signed-off-by: Hector Martin <marcan@marcan.st>
Without this, the OF core ends up limiting all DMA masks to the default
32-bit, since that runs before drivers set up the proper DMA mask.

Skipping the highest page because it is impossible to express a full
64-bit range in the DT.

Signed-off-by: Hector Martin <marcan@marcan.st>
Apple has it that way, and it might be important. Let's not risk it.

Signed-off-by: Hector Martin <marcan@marcan.st>
arm64: dts: apple: t6022-j180d: Add node for built-in PCIe devices

Currently only the two ethernet controllers and the SATA-AHCI are
detected. The USB controller (internal USB-A port and USB-A ports on the
I/O board) are missing code to toggle the reset gpio pin. The Broadcom
Wlan/BT device needs in addition the SMC power enable GPIO.
The "bluetooth0" and "wifi0" aliases can not be added since the ADT
misses calibration data for Wlan and BT.

arm64: dts: apple: Move PCIe-GE nodes intro their own file

These are only used on the Mac Pro (M2 Ultra, 2023) so do not bloat all
other DTBs.

Signed-off-by: Hector Martin <marcan@marcan.st>
Co-developed-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
The desktops will need to handle this on their own. On laptops it is a
little weird since dcp seems to handle the programming of the phy which
is apparently used for the internal display. It might be possible to
move this to the panel node once dcp is upstream ready. The
chosen.framebuffer node should reference the panel then.

In the meantime keep it always-on on notebooks.

Signed-off-by: Janne Grunau <j@jannau.net>
This patch adds measured opp-microwatt values for the
Firestorm and Icestorm application cores found in Apple's
T8103 (M1), T6000 (M1 Pro), T6001 (M1 Max) and T6002 (M1 Ultra) SoCs.

Values were measured from the System Management Controller's
core cluster power meter. A version of freqbench modified
to read this power meter was used to orchestrate testing,
running 1,000,000 iterations of coremark on a single core
from each cluster at each operating point. The bulk of the
testing was done on a T6000.

Note that Apple calibrates voltage regulator settings for
each SoC as they come off the assembly line, introducing some
natural variance between machines. Testing across multiple
machines with identical SoCs reveals no measurable impact
on the accuracy of the EM subsystem's cost calculations.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Enable energy-aware scheduling on devices with the Apple M2
SoC (T8112) by adding experimentally measured opp-microwatt
values to the application core OPP tables.

Values are an approximation calculated by the System Management Controller,
and collected using freqbench.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Signed-off-by: Eileen Yoon <eyn@gmx.com>
Signed-off-by: Eileen Yoon <eyn@gmx.com>
Co-developed-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Asahi Lina <lina@asahilina.net>
jannau and others added 19 commits March 1, 2026 17:37
After discussion with the devicetree maintainers we agreed to not extend
lists with the generic compatible "apple,spmi" anymore [1]. Use
"apple,t8103-spmi" as base compatible as it is the SoC the driver and
bindings were written for.

[1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/

Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Janne Grunau <j@jannau.net>
After discussion with the devicetree maintainers we agreed to not extend
lists with the generic compatible "apple,wdt" anymore [1]. Use
"apple,t8103-wdt" as base compatible as it is the SoC the driver and
bindings were written for.

[1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/

Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Janne Grunau <j@jannau.net>
After discussion with the devicetree maintainers we agreed to not extend
lists with the generic compatible "apple,nco" anymore [1]. Use
"apple,t8103-nco" as base compatible as it is the SoC the driver and
bindings were written for.

[1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/

Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
This is the core part of a power management co-processor present
on certain Apple SoCs. This driver starts the firmware, and
uploads the configuration and calibration data by pretending
to be IOKit.

Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
This driver manages a shared SRAM area that is used to communicate
desired power states of devices that PMP manages.

Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
Add the PMP device and set it as the power-domain for devices that
need to report their power states to it.

Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
@jannau
Copy link
Member

jannau commented Mar 13, 2026

Merged manually into bits/000-devicetree, bits/030-misc and bits/250-aop (for rust dependencies and to avoid conflicts in drivers/soc/apple/Kconfig).
I did some minor changes and added missing module description / license. Largest change is the added CONFIG_PMP_REPORT. I looked at that mostly because it was missing an OF dependency.

Currently disabled by commenting the pmp aliases until it is tested on all SoCs (t6001-j314c is broken).

@jannau jannau closed this Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants